// -*-c#-*-
//
// License: New BSD License : http://www.opensource.org/licenses/bsd-license.php
//
// Copyright (c) 2008, Brothers In Arms/Burl Nyswonger
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//    * Redistributions of source code must retain the above copyright
//      notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright
//      notice, this list of conditions and the following disclaimer in the
//      documentation and/or other materials provided with the distribution.
//    * Neither the name of Brothers In Arms/Burl Nyswonger nor the names
//      of its contributors may be used to endorse or promote products
//      derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ----------------------------------------------------------------------------
//
// January 12, 2008
//   Becaue I host this project on Google-Code, I am required to use one
//   of the licenses they provide.  The New BSD License seemed best to me.
//
//  Visit the project site to collaborate on development:
//      http://code.google.com/p/ut3-sniper-game
//
//  Visit Brothers In Arms:
//      http://bia-2k4.com
//
//  + Burl
//    aka: [BIA]DarthMushak
// ----------------------------------------------------------------------------
//@L

// +IncludeGuard+
`if(`notdefined(UCI_BIASTDINC))
`define UIC_BIASTDINC true


//
//   `#(...) -- seems to cast something to a number...
//
//   Stringification within macros:
//
//      " `whatever "
//
// outside of macros, this doesn't seem to work - should experiment, could be wrong...
//

//
// bwn: WARNING!!!! Trailing white-space is important!!!
// If I want a macro called MyInt that is "int" - then if
// there is no trailing whitespace in the `define, its a problem!
//
//   I want to say:
//      var MyInt Foo;
//
//  Without whitespace:
//    "`define MyInt int\n"   --> "var MyIntFoo;\n"
//
//  With Whitespace:
//    "`define MyInt int \n"  --> "var MyInt Foo;\n"
//                      ^
// NOTE ----------------|
//

// --------------------------------------------------------------------------

`define iInstr(a,b) Instr(Locs(`a),Locs(`b)) 


// Controller --> Player's Readable Name
`define ControllerToPlayerName(C) ((`C).IsA('Controller') ? (`C).PlayerReplicationInfo.PlayerName : "Player?")

`define BiaWarn(msg) LogInternal( "Bia-Warning: " $ default.Class $ ":" $ GetFuncName() $ "() - " $ `msg, 'ScriptWarning')
`define BiaError(msg) LogInternal( "Bia-ERROR: "  $ default.Class $ ":" $ GetFuncName() $ "() - " $ `msg, 'ScriptError')

// it works... sorta...
`define NameOf(x) ( (`x == `x) ? '`x' : '`x' )


`if(`isdefined(DEBUG))

`define BiaLog(msg) LogInternal( "bia-Log: " $ default.Class $ ":" $ GetFuncName() $ "() - " $ `msg, 'ScriptLog')
`define BiaEnter() `BiaLog("  +++ Enter")
`define BiaExit()  `BiaLog("  --- Exit")
`define BiaDbg(msg) LogInternal( "bia-Dbg: " $ default.Class $ ":" $ GetFuncName() $ "() - " $ `msg, 'ScriptLog')

`else

`define BiaLog(msg) LogInternal("Bia-Log: " $ `msg, 'ScriptLog')
`define BiaEnter()
`define BiaExit()
`define BiaDbg(msg)

`endif

`define BiaAssert(expr) if(!(`expr)) { `BiaError("Assertion Failed: " $ "`expr" ); } 



`endif
// -IncludeGuard-
